﻿/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework
 * Version 2.10
 * 
 * CNR Data Renderer Base Class
 *      Provides a base abstract definition for defining protocol-specific renderer instances.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;

namespace Adaptive.Foundation.Network.Cnr
{
    /// <summary>
    /// Provides a base abstract definition for defining protocol-specific renderer instances.
    /// </summary>
    public abstract class CnrDataRendererBase
    {
        /// <summary>
        /// Renders the error code object.
        /// </summary>
        /// <param name="errorCode">
        /// An <see cref="IErrorCode"/> instance to be rendered.
        /// </param>
        /// <returns>
        /// A string containing the rendering.
        /// </returns>
        public abstract string RenderErrorCode(IErrorCode errorCode);
        /// <summary>
        /// Renders the error code value object.
        /// </summary>
        /// <param name="rawFormat">
        /// The error code value as a raw string.
        /// </param>
        /// <returns>
        /// A string containing the rendering.
        /// </returns>
        public abstract string RenderErrorCodeValue(string rawFormat);
        /// <summary>
        /// Renders the command parameter object.
        /// </summary>
        /// <param name="parameter">
        /// An <see cref="CnrCommandParameterBase"/> instance to be rendered.
        /// </param>
        /// <returns>
        /// A string containing the rendering.
        /// </returns>
        public abstract string RenderParameter(CnrCommandParameterBase parameter);
        /// <summary>
        /// Renders a response to a command.
        /// </summary>
        /// <param name="responseInstance">
        /// The object instance to be rendered.
        /// </param>
        /// <returns>
        /// A string containing the rendering.
        /// </returns>
        public abstract string RenderResponse(CnrResponseBase responseInstance);
    }
}
